package lesson10;

import lesson05.B;

import javax.swing.*;
import java.awt.*;

public class TestFrame02 extends JFrame {
    private JButton btn1 = new JButton("按钮1");
    private JButton btn2 = new JButton("按钮2");
    private JButton btn3 = new JButton("按钮3");
    private JButton btn4 = new JButton("按钮4");
    private JButton btn5 = new JButton("按钮5");

    private BorderLayout borderLayout = new BorderLayout();
    private FlowLayout flowLayout = new FlowLayout();
    private GridLayout gridLayout = new GridLayout(3,2);
    public TestFrame02(){

//        this.setLayout(borderLayout);
//        this.setLayout(flowLayout);
        this.setLayout(gridLayout);
        this.add(btn1);
        this.add(btn2);
        this.add(btn3);
        this.add(btn4);
        this.add(btn5);

        this.setSize(800,600);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setLocationRelativeTo(null);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new TestFrame02();
    }
}
